﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SoftAdList.aspx.cs" Inherits="Crm_SoftAdList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="crm.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function()
        {
            var selobj = null;
            var selobjcolor = null;
            //d = this.style.backgroundColor; this.style.backgroundColor = '#D1F880';
            $(".trnei,.lupai").each(function()
            {

                $(this).click(function()
                {
                    try
                    {
                        selobj.css("background-color", selobjcolor);
                    }
                    catch (ex)
                    {
                    }
                    selobjcolor = $(this).css("background-color");
                    $(this).css("background-color", "#D1F880");
                    selobj = $(this);
                });
            });

        });
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div style="padding: 0 5px;">
        <div class="nav">
            当前位置：广告列表管理</div>
        <div style="margin-bottom: 5px;">
            <asp:Button ID="btnAddNew" runat="server" Text="添 加" OnClick="btnAddNew_Click" /></div>
        <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource1"
            DataKeyNames="ID" AllowPaging="True" AllowSorting="True">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="编号" InsertVisible="False" ReadOnly="True"
                    SortExpression="ID" Visible="false" />
                <asp:TemplateField HeaderText="编号">
                    <ItemTemplate>
                        <%#Container.DataItemIndex+1 %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="title" HeaderText="标题" SortExpression="title" />
                <asp:BoundField DataField="url" HeaderText="链接地址" SortExpression="url" />
                <asp:BoundField DataField="softname" HeaderText="软件名称" SortExpression="softname" />
                <asp:BoundField DataField="px" HeaderText="排序值" SortExpression="px" />
                <asp:CommandField HeaderText="操作" ShowDeleteButton="True" ShowEditButton="True" />
            </Columns>
        </asp:GridView>
    </div>
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/db.mdb"
        SelectCommand="SELECT * FROM [S_SoftAd] ORDER BY [px] DESC" DeleteCommand="DELETE FROM [S_SoftAd] WHERE [ID] = ?"
        InsertCommand="INSERT INTO [S_SoftAd] ([ID], [title], [url], [softname], [px]) VALUES (?, ?, ?, ?, ?)"
        UpdateCommand="UPDATE [S_SoftAd] SET [title] = ?, [url] = ?, [softname] = ?, [px] = ? WHERE [ID] = ?">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="title" Type="String" />
            <asp:Parameter Name="url" Type="String" />
            <asp:Parameter Name="softname" Type="String" />
            <asp:Parameter Name="px" Type="Int32" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="Int32" />
            <asp:Parameter Name="title" Type="String" />
            <asp:Parameter Name="url" Type="String" />
            <asp:Parameter Name="softname" Type="String" />
            <asp:Parameter Name="px" Type="Int32" />
        </InsertParameters>
    </asp:AccessDataSource>
    </form>
</body>
</html>
